$(function () {
    getScoreList();
    init();
})


function init() {
    $(".check-btn").on("click",function(){
        $(this).parent("li").find("div").each(function(){
            $(this).css("display","block");
        })
        $(this).parent("li").siblings("li").each(function(){
            $(this).find("div").each(function(){
                $(this).css("display","none");
            })
        })
    })
    $(".yesBtn").on("click",function(){
        $(this).parent("div").css("display","none");
        $(this).parent("div").prev().css("display","none");
    })

}

/*
  * @description : 获取用户评分
  * @params:
  * @author : peng huaneng
  * @date : 2018/1/18 9:33
  */
function getScoreList() {
    var html = "";
    // AJAX请求
    var data = {
        url: "../../image/myorder/food1.png",
        userName: "张三",
        userNameEn: "zhangsan",
        userArea: "成都",
        userAreaEn: "chengdu",
        score: 5,
        goodsName: "棒棒糖",
        goodsNameEn: "BBt",
        evaluation: "太好吃了，棒棒棒",
        evaluationEn: "this is very good !!!"
    };
    html = '<div class="row top">' +
        '<div class="row">' +
        '<div class="col-lg-1">' +
        '<img class="img-circle" src=' + data.url + ' > </div>' +
        '<div class="col-lg-2"> <div>' +
        '<div>' + data.userName + '</div>' +
        '<div>' + data.userNameEn + '</div>' +
        '</div>' +
        '<div>' + data.userArea + '</div>' +
        '<div>' + data.userAreaEn + '</div>' +
        '</div> </div> </div>' +
        '<div class="row">' +
        '<div class="col-lg-1">' +
        '<div>给出评分<br>score</div> </div>' +
        '<div class="col-lg-1">';
    if (data.score == 5) {
        html += '<img src="../../image/myorder/star.png">';
    }

    html += ' </div> <div class="col-lg-3">';
    html += '<div>' + data.goodsName + '</div>';
    html += '<div>' + data.goodsNameEn + '</div></div> </div> </div> <div>';
    html += '<textarea class="form-control" rows="3"  readonly="true">' + data.evaluation + '\n' + data.evaluationEn + '</textarea> </div> </div>';

    console.log(html);
    $("#evaluation_order_list").html(html + html);
}


var vm = new Vue({
    el:"#form",
    data:{
        categoryData:[
            {"id":1,"name":"类别选择","name_e":"leibiexuanze"},{"id":2,"name":"类别选择","name_e":"leibiexuanze"},{"id":3,"name":"类别选择","name_e":"leibiexuanze"},
            {"id":4,"name":"类别选择","name_e":"leibiexuanze"},{"id":5,"name":"类别选择","name_e":"leibiexuanze"},{"id":6,"name":"类别选择","name_e":"leibiexuanze"},
            {"id":7,"name":"类别选择","name_e":"leibiexuanze"},{"id":8,"name":"类别选择","name_e":"leibiexuanze"},{"id":9,"name":"类别选择","name_e":"leibiexuanze"},
            {"id":10,"name":"类别选择","name_e":"leibiexuanze"},{"id":11,"name":"类别选择","name_e":"leibiexuanze"},{"id":12,"name":"类别选择","name_e":"leibiexuanze"}
        ],
        typeData:[
            {"id":1,"name":"种类选择","name_e":"leibiexuanze"},{"id":2,"name":"种类选择","name_e":"leibiexuanze"},{"id":3,"name":"种类选择","name_e":"leibiexuanze"},
            {"id":4,"name":"种类选择","name_e":"leibiexuanze"},{"id":5,"name":"种类选择","name_e":"leibiexuanze"},{"id":6,"name":"种类选择","name_e":"leibiexuanze"},
            {"id":7,"name":"种类选择","name_e":"leibiexuanze"},{"id":8,"name":"种类选择","name_e":"leibiexuanze"},{"id":9,"name":"种类选择","name_e":"leibiexuanze"},
            {"id":10,"name":"种类选择","name_e":"leibiexuanze"},{"id":11,"name":"种类选择","name_e":"leibiexuanze"},{"id":12,"name":"种类选择","name_e":"leibiexuanze"}
        ],
        brandData:[
            {"id":1,"name":"品牌选择","name_e":"leibiexuanze"},{"id":2,"name":"品牌选择","name_e":"leibiexuanze"},{"id":3,"name":"品牌选择","name_e":"leibiexuanze"},
            {"id":4,"name":"品牌选择","name_e":"leibiexuanze"},{"id":5,"name":"品牌选择","name_e":"leibiexuanze"},{"id":6,"name":"品牌选择","name_e":"leibiexuanze"},
            {"id":7,"name":"品牌选择","name_e":"leibiexuanze"},{"id":8,"name":"品牌选择","name_e":"leibiexuanze"},{"id":9,"name":"品牌选择","name_e":"leibiexuanze"},
            {"id":10,"name":"品牌选择","name_e":"leibiexuanze"},{"id":11,"name":"品牌选择","name_e":"leibiexuanze"},{"id":12,"name":"品牌选择","name_e":"leibiexuanze"}
        ]
    },
    methods:{

    }
});